<template>
  <div ref="Dom" style="width: 100%; height: 100%;">

  </div>
</template>

<script>
  import Drow from "../../../../Echarts/temperature/line.js"
  export default {
    data() {
      return {
        data:[]
      }
    },
    mounted() {
      this.Drow();
    },
    created() {
      this.getinfo();
    },
    methods: {
      Drow,
      async getinfo() {
        const result = await this.axios.get("/api/tep");
        if (result.data.status === 200) {
          var axisData = [];
          for(let i = 0 ; i < result.data.Data.length;i++){
            let Hour =(result.data.Data[i].hour);
            let Temperature =(result.data.Data[i].tep);
            let newArr = [Hour,Temperature];
            axisData.push(newArr);
          }
          this.data = axisData;
          this.$store.commit("getInfo", this.data);
        }
      },

    },
    watch: {
      data() {
        this.Drow();
      }
    },
  }
</script>

<style>
</style>
